package com.bw.zyk.zhanggm.product.mq;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class KafkaTest {

    @Autowired
    KafkaTemplate kafkaTemplate;


    @KafkaListener(topics = {"2109test"})
    public void consumer(ConsumerRecord<String,String> consumerRecord, Acknowledgment acknowledgment) {

        String value = consumerRecord.value();
        log.info(value);

    }



}
